﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace Smart_Archives.Utils
{
    public class Md5Util
    {
        private static readonly string _salt="uP1ZubHkd5w7zoatHV8EvL5jqokzBuiD";
        /// <summary>
        /// md5加密
        /// </summary>
        /// <param name="input">输入字符</param>
        /// <returns></returns>
        public static string Md5Hash(string input)
        {
            using (var md5 = MD5.Create())
            {
                var result = md5.ComputeHash(Encoding.ASCII.GetBytes(input+ _salt));
                var strResult = BitConverter.ToString(result);
                return strResult.Replace("-", "");
            }
        }
    }
}
